<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let that
    function Star(uname) {
      // that = this  // true
      // console.log(this)
      this.uname = uname
    }

    // 原型对象里面函数的 this 指向的还是实例对象 ldh
    Star.prototype.sing = function () {
      that = this  // true
      console.log('唱歌')
    }

    // 实例对象 ldh
    const ldh = new Star('刘德华')
    ldh.sing()
    // 构造函数里面的 this  指向实例化对象 ldh
    console.log(that === ldh)  // true


    // 总结：构造函数和原型函数里面的this指向谁？  实例化的对象   下播！
  </script>
</body>

</html>